;;; ===========================================================================
; Copyright (c) 2008-2014, Broadcom Corporation
; All rights reserved.
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
; 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
; 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;; ===========================================================================

.ifndef KHRN_270X_IMAGE_INC
.define KHRN_270X_IMAGE_INC

; KHRN_IMAGE_FORMAT_T
.set IMAGE_FORMAT_MEM_LAYOUT_MASK, (0x7 << 0)
.set IMAGE_FORMAT_MEM_LAYOUT_SHIFT, 0
.set IMAGE_FORMAT_MEM_LAYOUT_BC, 3
.set IMAGE_FORMAT_RSO,   (0 << 0)
.set IMAGE_FORMAT_TF,    (1 << 0)
.set IMAGE_FORMAT_LT,    (2 << 0)
.set IMAGE_FORMAT_RSOTF, (3 << 0)
.set IMAGE_FORMAT_COMP_MASK, (0x3 << 6)
.set IMAGE_FORMAT_COMP_SHIFT, 6
.set IMAGE_FORMAT_COMP_BC, 2
.set IMAGE_FORMAT_UNCOMP,      (0 << 6)
.set IMAGE_FORMAT_ETC1,        (1 << 6)
.set IMAGE_FORMAT_PACKED_MASK, (2 << 6)
.set IMAGE_FORMAT_PIXEL_SIZE_MASK, (0x7 << 3)
.set IMAGE_FORMAT_PIXEL_SIZE_SHIFT, 3
.set IMAGE_FORMAT_PIXEL_SIZE_BC, 3
.set IMAGE_FORMAT_1,  (0 << 3)
.set IMAGE_FORMAT_4,  (1 << 3)
.set IMAGE_FORMAT_8,  (2 << 3)
.set IMAGE_FORMAT_16, (3 << 3)
.set IMAGE_FORMAT_24, (4 << 3)
.set IMAGE_FORMAT_32, (5 << 3)
.set IMAGE_FORMAT_PIXEL_TYPE_MASK, (0x3 << 8)
.set IMAGE_FORMAT_PIXEL_TYPE_SHIFT, 8
.set IMAGE_FORMAT_PIXEL_TYPE_BC, 2
.set IMAGE_FORMAT_COLOR,   (0 << 8)
.set IMAGE_FORMAT_PALETTE, (1 << 8)
.set IMAGE_FORMAT_SAMPLE,  (2 << 8)
.set IMAGE_FORMAT_DEPTH,   (3 << 8)
.set IMAGE_FORMAT_RGB,   (1 << 10)
.set IMAGE_FORMAT_L,     (1 << 11)
.set IMAGE_FORMAT_A,     (1 << 12)
.set IMAGE_FORMAT_XBGRX, (0 << 13)
.set IMAGE_FORMAT_XRGBX, (1 << 13)
.set IMAGE_FORMAT_AX,    (0 << 14)
.set IMAGE_FORMAT_XA,    (1 << 14)
.set IMAGE_FORMAT_RGB_BI,   10
.set IMAGE_FORMAT_L_BI,     11
.set IMAGE_FORMAT_A_BI,     12
.set IMAGE_FORMAT_XRGBX_BI, 13
.set IMAGE_FORMAT_XA_BI,    14
.set IMAGE_FORMAT_PIXEL_LAYOUT_MASK, (0x7 << 15)
.set IMAGE_FORMAT_PIXEL_LAYOUT_SHIFT, 15
.set IMAGE_FORMAT_PIXEL_LAYOUT_BC, 3
.set IMAGE_FORMAT_8888, (1 << 15)
.set IMAGE_FORMAT_888,  (1 << 15)
.set IMAGE_FORMAT_4444, (1 << 15)
.set IMAGE_FORMAT_5551, (2 << 15)
.set IMAGE_FORMAT_565,  (3 << 15)
.set IMAGE_FORMAT_88,   (4 << 15)
.set IMAGE_FORMAT_PRE, (1 << 18)
.set IMAGE_FORMAT_LIN, (1 << 19)
.set IMAGE_FORMAT_PRE_BI, 18
.set IMAGE_FORMAT_LIN_BI, 19
; some KHRN_IMAGE_FORMAT_Ts
.set ABGR_8888, (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_32 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_RGB | IMAGE_FORMAT_A | IMAGE_FORMAT_XBGRX | IMAGE_FORMAT_AX | IMAGE_FORMAT_8888)
.set XBGR_8888, (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_32 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_RGB | IMAGE_FORMAT_XBGRX | IMAGE_FORMAT_AX | IMAGE_FORMAT_8888)
.set RGBA_4444, (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_16 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_RGB | IMAGE_FORMAT_A | IMAGE_FORMAT_XRGBX | IMAGE_FORMAT_XA | IMAGE_FORMAT_4444)
.set RGBA_5551, (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_16 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_RGB | IMAGE_FORMAT_A | IMAGE_FORMAT_XRGBX | IMAGE_FORMAT_XA | IMAGE_FORMAT_5551)
.set RGB_565,   (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_16 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_RGB | IMAGE_FORMAT_XRGBX | IMAGE_FORMAT_565)
.set L_8,       (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_8 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_L)
.set L_1,       (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_1 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_L)
.set A_8,       (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_8 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_A)
.set A_4,       (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_4 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_A)
.set A_1,       (IMAGE_FORMAT_UNCOMP | IMAGE_FORMAT_1 | IMAGE_FORMAT_COLOR | IMAGE_FORMAT_A)

; KHRN_IMAGE_T
.set KHRN_IMAGE_FORMAT_OFFSET,  0
.set KHRN_IMAGE_WIDTH_OFFSET,   4
.set KHRN_IMAGE_HEIGHT_OFFSET,  6
.set KHRN_IMAGE_STRIDE_OFFSET,  8
.set KHRN_IMAGE_AUX_OFFSET,     12
.set KHRN_IMAGE_STORAGE_OFFSET, 16
.set KHRN_IMAGE_OFFSET_OFFSET,  20

; KHRN_IMAGE_CONV_T
.set IMAGE_CONV_GL, 0
.set IMAGE_CONV_VG, 1

.endif
